package com.ruoyi.project.jiaqin.advert.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.advert.mapper.JiaqinAdvertMapper;
import com.ruoyi.project.jiaqin.advert.domain.JiaqinAdvert;
import com.ruoyi.project.jiaqin.advert.service.IJiaqinAdvertService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 广告列表Service业务层处理
 *
 * @author admin
 * @date 2021-01-11
 */
@Service
public class JiaqinAdvertServiceImpl implements IJiaqinAdvertService
{
    @Autowired
    private JiaqinAdvertMapper jiaqinAdvertMapper;

    /**
     * 查询广告列表
     *
     * @param id 广告列表ID
     * @return 广告列表
     */
    @Override
    public JiaqinAdvert selectJiaqinAdvertById(String id)
    {
        return jiaqinAdvertMapper.selectJiaqinAdvertById(id);
    }

    @Override
    public List<JiaqinAdvert> selectAll() {
        return jiaqinAdvertMapper.selectAll();
    }

    @Override
    public List<JiaqinAdvert> selectJiaqinAdvertByPutAddr(Integer putAddr) {
        return jiaqinAdvertMapper.selectJiaqinAdvertByPutAddr(putAddr);
    }


    /**
     * 查询广告列表列表
     *
     * @param jiaqinAdvert 广告列表
     * @return 广告列表
     */
    @Override
    public List<JiaqinAdvert> selectJiaqinAdvertList(JiaqinAdvert jiaqinAdvert)
    {
        return jiaqinAdvertMapper.selectJiaqinAdvertList(jiaqinAdvert);
    }

    /**
 * 新增广告列表
 *
 * @param jiaqinAdvert 广告列表
 * @return 结果
 */
@Override
public int insertJiaqinAdvert(JiaqinAdvert jiaqinAdvert)
{
    jiaqinAdvert.setId(UUID.randomUUID().toString().replace("-",""));
    return jiaqinAdvertMapper.insertJiaqinAdvert(jiaqinAdvert);
}

    /**
     * 修改广告列表
     *
     * @param jiaqinAdvert 广告列表
     * @return 结果
     */
    @Override
    public int updateJiaqinAdvert(JiaqinAdvert jiaqinAdvert)
    {
        return jiaqinAdvertMapper.updateJiaqinAdvert(jiaqinAdvert);
    }

    /**
     * 删除广告列表对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJiaqinAdvertByIds(String ids)
    {
        return jiaqinAdvertMapper.deleteJiaqinAdvertByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除广告列表信息
     *
     * @param id 广告列表ID
     * @return 结果
     */
    @Override
    public int deleteJiaqinAdvertById(String id)
    {
        return jiaqinAdvertMapper.deleteJiaqinAdvertById(id);
    }
}
